#include <cstdio>
#include <cstring>
#define N 1001
using namespace std;

int t, n, m, k;
int f[N][N];
int edge[N][N];
int main() {
	freopen("testdata.in", "r", stdin);
	freopen("testdata.out", "w", stdout);
	scanf("%d", &t);
	while (t--) {
		memset(f, 0, sizeof(f));
		scanf("%d%d%d", &n, &m, &k);
		int x, y, c;
		for (int i = 1; i <= k; ++i) {
			scanf("%d%d%d", &x, &y, &c);
			edge[x][y] = c;
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}